package com.wing.cms.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import com.wing.cms.ext.domain.CustomPortletInerface;
import com.wing.common.util.ObjectToIO;


@Entity
@Table(name = "cms_portletinstance_c")
public class  Portlet_C {

  	@Id
  	@Column(name = "id")
  	private String id;
  	@Column(name = "templateid")
  	private String templateid;
  	@Column(name = "title")
  	private String title;
  	@Column(name = "titlecolor")
  	private String titlecolor;
  	@Column(name = "portletwidth")
  	private int portletwidth;
  	@Column(name = "portletheight")
  	private int portletheight;
  	@Column(name = "titlepic")
  	private String titlepic;
  	@Column(name = "titletype")
  	private String titletype;
  	@Column(name = "objecttype")
  	private String objecttype;
  	@Column(name = "object")
  	private byte[] object;
  	
  	private Object objectView;
  
  

  	public String getTitlepic() {
		return titlepic;
	}
	public void setTitlepic(String titlepic) {
		this.titlepic = titlepic;
	}
	public String getTitletype() {
		return titletype;
	}
	public void setTitletype(String titletype) {
		this.titletype = titletype;
	}
	public void  setId(String id){
  		this.id = id;
  	}
	public String getId(){
  		return this.id; 
  	}
  	public void  setTemplateid(String templateid){
  		this.templateid = templateid;
  	}
	public String getTemplateid(){
  		return this.templateid; 
  	}
  	public void  setTitle(String title){
  		this.title = title;
  	}
	public String getTitle(){
  		return this.title; 
  	}
  	public void  setTitlecolor(String titlecolor){
  		this.titlecolor = titlecolor;
  	}
	public String getTitlecolor(){
  		return this.titlecolor; 
  	}
  	public void  setPortletwidth(int portletwidth){
  		this.portletwidth = portletwidth;
  	}
	public int getPortletwidth(){
  		return this.portletwidth; 
  	}
  	public void  setPortletheight(int portletheight){
  		this.portletheight = portletheight;
  	}
	public int getPortletheight(){
  		return this.portletheight; 
  	}
	public byte[] getObject() {
		return object;
	}
	public void setObject(byte[] object) {
		this.object = object;
	}
	public CustomPortletInerface getObjectView() throws Exception {
		return (CustomPortletInerface)ObjectToIO.bytesToObject(this.object);
	}
	public void setObjectView(CustomPortletInerface cp) throws Exception {
		this.object = ObjectToIO.objectToBytes(cp);
	}
	public String getObjecttype() {
		return objecttype;
	}
	public void setObjecttype(String objecttype) {
		this.objecttype = objecttype;
	}

}
